package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.model.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 品牌表 业务实现类
 *
 * @author atguigu
 * @since 2023-04-18
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark> implements BaseTrademarkService {
    /**
     * 查询品牌管理分页列表
     * @param page1
     * @return
     */
    @Override
    public Page<BaseTrademark> getBaseTrademark(Page<BaseTrademark> page1) {
        //按照时间进行排序
        LambdaQueryWrapper<BaseTrademark> baseTrademarkLambdaQueryWrapper = new LambdaQueryWrapper<>();
        baseTrademarkLambdaQueryWrapper.orderByDesc(BaseTrademark::getCreateTime);
        Page<BaseTrademark> page = this.page(page1,baseTrademarkLambdaQueryWrapper);
        return page;
    }

}
